import 'package:car_map/mode/byrent_car_model.dart';
import 'package:car_map/page/res/styles.dart';
import 'package:flutter/material.dart';

import 'load_image.dart';

class WidgetByrentCarItem extends StatelessWidget {
  final ByrentCarModel byrentCarModel;

  const WidgetByrentCarItem({Key key, this.byrentCarModel}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Card(
      child: Container(
        padding: EdgeInsets.only(bottom: 10.0),
//        height: ScreenUtil().setHeight(200),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            ClipRRect(
              borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(5.0),
                  topRight: Radius.circular(5.0)),
              child: LoadImage(
                byrentCarModel.urlPath,
              ),
            ),
//            Gaps.vGap5,
            Container(
              alignment: Alignment.topLeft,
              padding: EdgeInsets.only(left: 10.0, top: 5.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Text(
                    '${byrentCarModel.carName}',
                    style: TextStyles.textBold16,
                  ),
//            Gaps.vGap5,
                  Text(
                    '租金:${byrentCarModel.money}元',
                    style: TextStyles.textDarkGray14,
                  ),
//            Gaps.vGap5,
                  Text(
                    '超时:${byrentCarModel.Hmoney}元/小时',
                    style: TextStyles.textDarkGray14,
                  ),
//            Gaps.vGap5,
                  Text(
                    '超距:${byrentCarModel.Kmoney}元/km',
                    style: TextStyles.textDarkGray14,
                  ),
//            Gaps.vGap5,
                  Text(
                    '位置:${byrentCarModel.address}',
                    style: TextStyles.textDarkGray14,
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
